<?php
/**
 * Created by PhpStorm.
 * User: GZJ
 * Date: 2017/4/10
 * Time: 17:02
 */
namespace Admin\Controller;
use Think\Controller;

class BaseController extends Controller{
        public function __construct()
        {
            //必须先调用父类
            parent::__construct();
            // 判断登录状态
            if(!session('id')){
                $this->error('您没有权限操作！请先登录...',U('Login/login'));
            }
            if(CONTROLLER_NAME=='Index'){
                return TRUE;
            }
            $priModel = D('Privilege');
            if(!$priModel->chk_pri()){
                $this->error('您没有权限操作!');

            }
        }

}